home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qtimer.h.z / qtimer.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  1.6 KB  |  70 lines

  1. /****************************************************************************
  2. ** $Id: qtimer.h,v 2.4 1998/07/03 00:09:41 hanord Exp $
  3. **
  4. ** Definition of QTimer class
  5. **
  6. ** Created : 931111
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QTIMER_H
  25. #define QTIMER_H
  26.  
  27. #ifndef QT_H
  28. #include "qobject.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QTimer : public QObject
  33. {
  34.     Q_OBJECT
  35. public:
  36.     QTimer( QObject *parent=0, const char *name=0 );
  37.    ~QTimer();
  38.  
  39.     bool    isActive() const;
  40.  
  41.     int        start( int msec, bool sshot = FALSE );
  42.     void    changeInterval( int msec );
  43.     void    stop();
  44.  
  45.     static void singleShot( int msec, QObject *receiver, const char *member );
  46.  
  47. signals:
  48.     void    timeout();
  49.  
  50. protected:
  51.     bool    event( QEvent * );
  52.  
  53. private:
  54.     int        id;
  55.     bool    single;
  56.  
  57. private:    // Disabled copy constructor and operator=
  58.     QTimer( const QTimer & );
  59.     QTimer &operator=( const QTimer & );
  60. };
  61.  
  62.  
  63. inline bool QTimer::isActive() const
  64. {
  65.     return id >= 0;
  66. }
  67.  
  68.  
  69. #endif // QTIMER_H
  70.